﻿<UserControl x:Class="MicroFlasher.Views.DeviceBitsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:devices="clr-namespace:MicroFlasher.Devices;assembly=MicroFlasher"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance devices:DeviceBits}">

    <ItemsControl ItemsSource="{Binding Path=Groups}">
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                    <StackPanel Orientation="Vertical" Margin="5">
                        <TextBlock Text="{Binding Path=Name}" FontWeight="Bold" FontSize="16" Margin="5" />
                        <ItemsControl ItemsSource="{Binding Path=VisibleBits}">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <WrapPanel />
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <CheckBox Content="{Binding Path=Name}" IsChecked="{Binding Path=Value, Mode=TwoWay}" Margin="5" ToolTip="{Binding Path=Description}" />
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                    </StackPanel>
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>
</UserControl>
